package com.gmail.fanvaron.Listener;

import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;

import com.gmail.fanvaron.Main.MarvMonsterPack;

public class InteractListener implements Listener {

	public MarvMonsterPack plugin;

	public InteractListener(MarvMonsterPack instance) {
		plugin = instance;
	}

	@EventHandler
	public void onInteract(PlayerInteractEvent event) {

		if ((!event.getPlayer().isOp())
				&& (event.getClickedBlock() != null)
				&& ((event.getClickedBlock().getType()
						.equals(Material.DIODE_BLOCK_OFF)) || (event
						.getClickedBlock().getType()
						.equals(Material.DIODE_BLOCK_ON)||event
						.getClickedBlock().getType()
						.equals(Material.DISPENSER)||event
						.getClickedBlock().getType()
						.equals(Material.DROPPER)))) {
			event.setCancelled(true);
		}

	}

}
